Estimation method for data access performance

ABSTRACT

The invention provides an estimation method for data access performance, which is applied in a computer system. The computer system comprises a host and a flash memory device having a controller and a plurality of blocks. When the host transmits a writing performance query instruction to the flash memory device. The controller determines whether the free block can accommodate the amount of data to be written; if so, it replies an optimal writing performance to the host; if not, it selects at least one block for executing a garbage collection process, calculates a weight ratio based on the amount of valid data divided by the sum of the amount of valid data and the amount of data to be written to generate an estimated writing performance that is replied to the host, and execute the garbage collection process for the selected block to generate a new free block.

This non-provisional application claims priority claim under 35 U.S.C. § 119 (a) on Taiwan Patent Application No. 106141735 filed Nov. 30, 2017, the entire contents of which are incorporated herein by reference.

FIELD OF THE INVENTION

The present invention relates to an estimation method for data access performance, more particularly, to an estimation method for data access performance of flash memory device.

BACKGROUND

With the evolution of semiconductor technology, the capacity of flash memory device, for example, SSD, has become larger and larger. The flash memory device has gradually become a main data storage media of servo host or video device.

Since the servo host or the video device often needs to write or read a large amount of data, the access performance of the flash memory device will directly affect the access speed of the data of the servo host or the video device. In the past, the servo host typically uses a testing software to test the access performance of the flash memory device. When the servo host tests the access performance of the flash memory device by the testing software, it will transmit some testing data to the flash memory device by a data transmission interface, and test the read and write speed of the flash memory device by the use of these testing data, so as to estimate the access performance of the flash memory device. The servo host uses the testing software to estimate the access performance of the flash memory device, which is easy to affect the estimated access performance due to the delay of transmission of the test data, transmission interference or some external emergency.

For the above reason, the present invention provides an innovative method for estimating the data access performance of the flash memory device, in which the estimation of access performance can be self-performed by the flash memory device to avoid the external emergency to affect the estimation of the access performance of the flash memory device, which is the object to be achieved by the present invention.

SUMMARY

It is one objective of the present invention to provide an estimation method for data access performance, which is applied in a computer system having a host and a flash memory device. When the host wants to execute an estimation of writing performance for the flash memory device, it transmits a writing performance query instruction to the flash memory device. The flash memory device proceeds a writing performance estimation process after receiving the writing performance query instruction. During the writing performance estimation process executes, the flash memory device determines whether the data space of internal free block can accommodate the amount of data to be written; if so, it will transmit a reply signal indicating an optimal writing performance to the host, and if not, it will select at least one block with data stored to execute a garbage collection process, and calculates a weight ratio based on the amount of valid data within the selected block divided by the sum of the amount of valid data within the selected block and the amount of data to be written so as to generate an estimated writing performance; then, the flash memory device transmits a reply signal including the estimated writing performance to the host.

It is another objective of the present invention to provide an estimation method for data access performance, in which the flash memory device can record an average retry times of shift read, define a plurality of threshold intervals based on the average retry times of shift read, and sets a plurality of estimated reading performances, each of which respectively corresponds to one of the threshold intervals. When the host wants to execute an estimation of reading performance for the flash memory device, it transmits a reading performance query instruction to the flash memory device. The flash memory device proceeds a reading performance estimation process after receiving the reading performance query instruction. During the reading performance estimation process executes, the flash memory device determines the threshold interval within which the average retry times of shift read is located to inquire the corresponding estimated reading performance. Then, the flash memory device transmits a reply signal including the estimated reading performance to the host.

To achieve the above objective, the present invention provides an estimation method for data access performance, which is applied in a computer system having a host and a flash memory device, the flash memory device comprising a controller and a flash memory module, the flash memory module comprising a plurality of blocks that includes at least one free block with no data stored, steps of the estimation method comprising: transmitting a writing performance query instruction, which indicates the amount of data to be written, to the flash memory device via the host; and demanding the controller of the flash memory device to execute a writing performance estimation process after receiving the writing performance query instruction, steps of the writing performance estimation process comprising: determining whether data space of the free block is sufficient to accommodate the amount of data to be written, if so, transmitting a reply signal indicating an optimal writing performance to the host, if not, executing a garbage collection process; steps of the garbage collection process comprising: selecting at least one the block, from these blocks with data stored, to be executed the garbage collection process; determining the amount of valid data within the selected block; calculating a weight ratio based on the amount of valid data within the selected block divided by the sum of the amount of valid data within the selected block and the amount of data to be written; subtracting the weight ratio from the optimal writing performance to obtain an estimated writing performance; transmitting a reply signal indicating the estimated writing performance to the host; and executing the garbage collection for the selected block to move the valid data in the selected block into other blocks and erase all data in the selected block such that the selected block becomes the new free block.

In one embodiment of the present invention, wherein the block selected by the controller to be executed the garbage collection process is a block having the least amount of valid data.

In one embodiment of the present invention, further comprising the following steps: demanding the host to write data into the free block of the flash memory module in sequence after receiving the reply signal indicating the optimal writing performance or the estimated writing performance.

In one embodiment of the present invention, further comprising the following steps: demanding the controller to determine whether to receive the next writing performance query instruction after the garbage collection process has executed; and demanding the controller to execute the writing performance estimation process, again, after receiving the next writing performance query instruction.

In one embodiment of the present invention, wherein each of blocks comprises a plurality of pages, the controller records a retry times of shift read belonging to each of the pages, and obtains an average retry times of shift read based on the sum of the retry times of shift read for all the pages divided by the total number of the pages.

In one embodiment of the present invention, wherein the controller defines a plurality of threshold intervals according to the average retry times of shift read, and sets a plurality of estimated reading performances, each of the estimated reading performances corresponds to one of the threshold intervals.

In one embodiment of the present invention, further comprising the following steps: transmitting a reading performance query instruction to the flash memory device via the host; and demanding the controller of the flash memory device to execute a reading performance estimation process after receiving the reading performance query instruction, steps of the reading performance estimation process comprising: determining the threshold interval within which the average retry times of shift read is located to inquire the corresponding estimated reading performance; and transmitting a reply signal including the estimated reading performance to the host.

In one embodiment of the present invention, further comprising the following steps: demanding the controller to determine whether to receive the next reading performance query instruction after the reading performance estimation process has executed; and demanding the controller to execute the reading performance estimation process, again, after receiving the next writing performance query instruction.

The present invention further comprises an estimation method for data access performance, which is applied in a computer system having a host and a flash memory device, the flash memory device comprising a controller and a flash memory module, the flash memory module comprising a plurality of blocks, each of the blocks comprising a plurality of pages, steps of the estimation method comprising: demanding the controller to record a retry times of shift read belonging to each of the pages and obtain an average retry times of shift read based on the sum of the retry times of shift read for all the pages divided by the total number of the pages; demanding the controller to define a plurality threshold intervals according to the average retry times of shift read; setting a plurality of estimated reading performances, wherein each of the estimated reading performances corresponds to one of the threshold intervals; transmitting a reading performance query instruction to the flash memory device via the host; and demanding the controller of the flash memory device to execute a reading performance estimation process after receiving the reading performance query instruction, steps of the reading performance estimation process comprising: determining the threshold interval within which the average retry times of shift read is located to inquire the corresponding estimated reading performance; and transmitting a reply signal including the estimated reading performance to the host.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a structural diagram of a computer system according to one embodiment of the present invention.

FIG. 2 is a schematic diagram of data structure of a flash memory module according to one embodiment of the present invention.

FIG. 3 is a flow chart of the computer system estimating a data access performance according to one embodiment of the present invention.

FIG. 4 is a flow chart of the computer system estimating a writing performance according to one embodiment of the present invention.

FIG. 5 is a flow chart of the computer system estimating a reading performance according to one embodiment of the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

Referring to FIGS. 1 and 2, there are shown a structural diagram of a computer system according to one embodiment of the present invention, and a schematic diagram of data structure of a flash memory module according to one embodiment of the present invention. As shown in FIGS. 1 and 2, the computer system 100 of the present invention comprises a host 10 and a flash memory device 30. The host 10 can be used for estimating data access performance (such as writing performance/reading performance) to the flash memory device 30. The flash memory device comprises a controller 31 and at least one flash memory module 33. The flash memory module 33 comprises a plurality of blocks 351, 352, 353, 354, and 359. Each of blocks 351, 352, 353, 354, 359 consists of a plurality of pages 361, respectively. The size of each page 361 may be 4 k, 8 k, 16 k, or 32 k bytes. At least one of these blocks 351, 352, 353, 354, 359 is free block without data stored, for example, the blocks 351, 352 are the free blocks. The controller 31 comprises a firmware 311 and a temporary table 313. The controller 31 can operate an estimating process for data access performance by the use of the firmware 311, and record the data stored in each of pages 361 to be a valid data or an invalid data by the temporary table 313.

Referring to FIGS. 3 and 4, there are shown a flow chart of the computer system estimating a data access performance according to one embodiment of the present invention, and a flow chart of the computer system estimating a writing performance according to one embodiment of the present invention, as well as simultaneously referring FIGS. 1 and 2. Firstly, in step 510, when the host 10 wants to execute an estimation of writing performance to the flash memory device 30, it will transmit a writing performance query instruction 101 to the flash memory device 30. The writing performance query instruction 101 indicates the amount of data to be written to the flash memory device 30 by the host 10. The flash memory device 30 proceed a writing performance estimation process S52 after receiving the writing performance query instruction 101.

In step S521 of the writing performance estimation process S52, the controller 31 determines whether data spaces of the free blocks 351, 352 are sufficient to accommodate the amount of data 102 to be written. In step S522, if the controller 31 determines that the data spaces of the free blocks 351, 352 can accommodate the amount of data 102 to be written, it will transmit a reply signal 321 indicating an optimal writing performance (A1) 322 to the host 10. In the present invention, the optimal writing performance (A1) 322 is a percentage value, which is set to 100%. When the host 10 receives the reply signal 321 of the optimal writing performance (A1=100%) 322, it can know that the data spaces of the current free blocks 351, 352 are able to accommodate the amount of data 102 to be written by the host 10 such that the data provided by the host 10 can be written to the free blocks 351, 352 at the fastest write rate, for example, the highest write rate of the flash memory device 30.

For instance, the data space of each of the blocks 351, 352, 353, 354, 359 in the flash memory module 33 is 1 GB (1G bytes). When the host 10 notifies the flash memory device 30 that the amount of data of 1 GB to be written to the flash memory module 33, the controller 31 of the flash memory device 30 determines that the current free data spaces (such as the free blocks 351, 352) are 2 GB, which are sufficient to accommodate the amount of data 102 to be written by the host 10, and therefore replies the message including the optimal writing performance (A1=100%) 322 to the host 10, such that the 1 GB of data can be written to the free block 351 or 352 by the host 10 at the fastest write rate.

On the contrary, if the controller 31 of the flash memory device 30 determines that the data spaces of the current free blocks 351, 352 are unable to accommodate the amount of data 102 to be written, it will execute a garbage collection process S53 for one or more blocks 353, 354, 359 to clear all data stored within the blocks 353, 354, and/or 359 and therefore generate more free blocks. For instance, when the host 10 notifies the flash memory device 30 that it wants to write the amount of data of 3 GB to the flash memory module 33, the controller 31 of the flash memory device 30 determines that the current free data spaces (such as the free blocks 351, 352) are only 2 GB, which are not sufficient to accommodate the amount of data 102 of 3 GB to be written. Therefore, the controller 31 will execute the garbage collection process for the block 353, 354, or 359 to clear up the data stored within the block 353, 354, or 359 such that the block 353, 354, or 359 can become the new free block. Besides, the flash memory device 30 is required to move the valid data for the block where the garbage collection process is to be executed; however, the movement of data will affect the speed at which the host 10 writes data to the flash memory device 30, and thus fall the writing performance of the flash memory device 30. Accordingly, the flash memory device 30 of the present invention can calculate the writing portion affected by the movement of data during the execution of the garbage collection process, and subtract the affected writing portion from the optimum writing performance (A1) 322 to estimate the actual writing performance of the flash memory device 30 during the execution of the garbage collection process.

In step S531 of the garbage collection process S53, the firmware 311 of the controller 31 selects at least one block (such as the block 353), from these blocks 353, 354 with data stored, 359, to be executed the garbage collection process. In one preferred embodiment of the invention, the firmware 311 of the controller 31 will preferentially select the block having the least amount of valid data as a block for executing the garbage collection process. For example, the amount of valid data of the block 353 is 200 MB, the amount of valid data of the block 354 is 300 MB, the amount of valid data of the block 359 is 500 MB, the controller 31 can preferentially select the block 353 to execute the garbage collection process. Next, in step S532, the controller 31 determines the amount of valid data within the selected block 353, for example, 200 MB. The controller 31 calculates a weight ratio based on the amount of valid data within the selected block 353 divided by the sum of the amount of valid data within the selected block 353 and the amount of data to be written.

For example,

$Z = {\frac{X}{X + Y} = {\frac{200\mspace{14mu} {MB}}{{200\mspace{14mu} {MB}} + {3\mspace{14mu} {GB}}} = {6.25\%}}}$

wherein X is the amount of valid data within the selected block 353, Y is the amount of data to be written, and Z is the weight ratio. Afterwards, the weight ratio (Z) is subtracted from the optimal writing performance (A1) 322 to obtain an estimated writing performance (A2) 324 of the flash memory device 30 operating in the garbage collection process. For example, A2=A1-Z=100%-6.25%=93.75%. In step S534, the controller 31 transmits a reply signal 323 including the estimated writing performance (A2=93.75%) 324 to the host 10 after the estimated writing performance (A2) 324 has obtained, the host 10 can know the writing performance of the flash memory device 30 during the garbage collection. In step S535, the controller 31 moves all of the valid data within the selected block 353 into other block 359, and erases all data in the selected block 353 such that the selected block 353 becomes a new free block. Furthermore, the controller 31 can write data into the free block 351, 352 or 353 at a speed of the estimated writing performance (A2) when the garbage collection process is operating in the selected block 35. After the controller 31 has executed the garbage collection process, it returns to step S510 to determine whether to receive the next writing performance query instruction 101; if so, the writing performance estimation process S52 is executed for the flash memory device 30, again.

Referring to FIG. 5, there is shown a flow chart of the computer system estimating a reading performance according to one embodiment of the present invention, as well as simultaneously referring FIGS. 1 and 3. In general, the threshold voltage of the memory cell (such as NAND flash memory cell) may shift because of the flash memory module 33 of the flash memory device 30 gradually aging with the use time. Therefore, the controller 31 may need to perform multiple retries of shift read for the pages 361 of the flash memory module 33 so as to read out the correct data. Accordingly, the controller 31 records a retry times 311 of shift read belonging to each of the pages 361 of the flash memory module 33, respectively, and obtains an average retry times 3113 of shift read based on the sum of the retry times 3111 of shift read for all the pages 361 divided by the total number of the pages 361. Besides, the firmware 311 of the controller 31 defines a plurality of threshold intervals 3115 according to the average retry times 3113 of shift read, and sets a plurality of estimated reading performances (B1) 326, each of which respectively corresponds to one of the threshold intervals 3115. The average retry times 3113 of shift read is lower, which will correspond to a higher estimated reading performance (B1) 326; on the contrary, the average retry times 3113 of shift read is higher, which will correspond to a lower estimated reading performance (B1) 326. For example, the average retry times 3113 of shift read is zero to one times, which will be located at a first threshold interval and correspond to the estimated reading performance (B1) 326 of 100%; the average retry times 3113 of shift read is one to two times, which will be located at a second threshold interval and correspond to the estimated reading performance (B1) 326 of 90%; the average retry times 3113 of shift read is two to three times, which will be located at a third threshold interval and correspond to the estimated reading performance (B1) 326 of 80%; the average retry times 3113 of shift read is three to four times, which will be located at a fourth threshold interval and correspond to the estimated reading performance (B1) 326 of 70%; otherwise, the average retry times 3113 of shift read is more than five times, which will be located at a fifth threshold interval and correspond to the estimated reading performance (B1) 326 to be less than 50%.

In step S510, when the host 10 wants to estimate a writing performance or a reading performance for the flash memory device 30, it will transmit a writing performance query instruction 101 or a reading performance query instruction 103 to the flash memory device 30. In step S511, when the controller 31 of the flash memory device 30 receives a query instruction related with the data access performance, it will determine whether the received query instruction is a writing performance query instruction 101. If the received query instruction is the writing performance query instruction 101, the controller 31 proceeds to the writing performance estimation process S52; otherwise, the controller 31 proceeds to the reading performance estimation process S54.

In step S541 of the reading performance estimation process S54, the controller 31 obtains the average retry times 3113 of shift read related to the flash memory module 33 from the firmware 311. In step S542, the controller 31 determines the threshold interval 3115 within which the average retry times 3113 of shift read is located to query the corresponding estimated reading performance (B1) 326. In step S543, the controller 31 transmits a reply signal 325 including the estimated reading performance (B1) 326 to the host 10 so that the host 10 can know the reading performance of the flash memory device 30 currently, and read data from the flash memory module 33 at a speed of the estimated reading performance (B1) 326, or know the wearing of the flash memory module 33 based on the estimated reading performance (B1) 326. After the step S543 has executed, it returns to steps S510 and S511 to determine whether to receive the next reading performance query instruction 103 from the host 10; if so, the controller 31 proceeds the reading performance estimation process S54, again.

Summing up, the computer system 100 of the present invention provides a mechanism for estimating the data access performance of the flash memory device 30, in which the estimation of the writing performance or the reading performance for the flash memory device 30 can be self-executed by the flash memory device 30 so as to obtain an accurate estimation result of writing performance or reading performance. The estimation result of writing performance or reading performance will be transmitted to the host 10, such that the host 10 can know the reading and writing situation of the flash memory device 30.

The above disclosure is only the preferred embodiment of the present invention, and not used for limiting the scope of the present invention. All equivalent variations and modifications on the basis of shapes, structures, features and spirits described in the claims of the present invention should be included in the claims of the present invention. 

What is claimed is:
 1. An estimation method for data access performance, which is applied in a computer system having a host and a flash memory device, the flash memory device comprising a controller and a flash memory module, the flash memory module comprising a plurality of blocks that includes at least one free block with no data stored, steps of the estimation method comprising: transmitting a writing performance query instruction, which indicates the amount of data to be written, to the flash memory device via the host; and demanding the controller of the flash memory device to execute a writing performance estimation process after receiving the writing performance query instruction, steps of the writing performance estimation process comprising: determining whether data space of the free block is sufficient to accommodate the amount of data to be written, if so, transmitting a reply signal indicating an optimal writing performance to the host, if not, executing a garbage collection process; steps of the garbage collection process comprising: selecting at least one the block, from these blocks with data stored, to be executed the garbage collection process; determining the amount of valid data within the selected block; calculating a weight ratio based on the amount of valid data within the selected block divided by the sum of the amount of valid data within the selected block and the amount of data to be written; subtracting the weight ratio from the optimal writing performance to obtain an estimated writing performance; transmitting a reply signal indicating the estimated writing performance to the host; and executing the garbage collection for the selected block to move the valid data in the selected block into other blocks and erase all data in the selected block such that the selected block becomes the new free block.
 2. The estimation method according to claim 1, wherein the block selected by the controller to be executed the garbage collection process is a block having the least amount of valid data.
 3. The estimation method according to claim 1, further comprising the following steps: demanding the host to write data into the free block of the flash memory module in sequence after receiving the reply signal indicating the optimal writing performance or the estimated writing performance.
 4. The estimation method according to claim 1, further comprising the following steps: demanding the controller to determine whether to receive the next writing performance query instruction after the garbage collection process has executed; and demanding the controller to execute the writing performance estimation process, again, after receiving the next writing performance query instruction.
 5. The estimation method according to claim 1, wherein each of blocks comprises a plurality of pages, the controller records a retry times of shift read belonging to each of the pages, and obtains an average retry times of shift read based on the sum of the retry times of shift read for all the pages divided by the total number of the pages.
 6. The estimation method according to claim 5, wherein the controller defines a plurality of threshold intervals according to the average retry times of shift read, and sets a plurality of estimated reading performances, each of the estimated reading performances corresponds to one of the threshold intervals.
 7. The estimation method according to claim 6, further comprising the following steps: transmitting a reading performance query instruction to the flash memory device via the host; and demanding the controller of the flash memory device to execute a reading performance estimation process after receiving the reading performance query instruction, steps of the reading performance estimation process comprising: determining the threshold interval within which the average retry times of shift read is located to inquire the corresponding estimated reading performance; and transmitting a reply signal including the estimated reading performance to the host.
 8. The estimation method according to claim 7, further comprising the following steps: demanding the controller to determine whether to receive the next reading performance query instruction after the reading performance estimation process has executed; and demanding the controller to execute the reading performance estimation process, again, after receiving the next writing performance query instruction.
 9. An estimation method for data access performance, which is applied in a computer system having a host and a flash memory device, the flash memory device comprising a controller and a flash memory module, the flash memory module comprising a plurality of blocks, each of the blocks comprising a plurality of pages, steps of the estimation method comprising: demanding the controller to record a retry times of shift read belonging to each of the pages and obtain an average retry times of shift read based on the sum of the retry times of shift read for all the pages divided by the total number of the pages; demanding the controller to define a plurality threshold intervals according to the average retry times of shift read; setting a plurality of estimated reading performances, wherein each of the estimated reading performances corresponds to one of the threshold intervals; transmitting a reading performance query instruction to the flash memory device via the host; and demanding the controller of the flash memory device to execute a reading performance estimation process after receiving the reading performance query instruction, steps of the reading performance estimation process comprising: determining the threshold interval within which the average retry times of shift read is located to inquire the corresponding estimated reading performance; and transmitting a reply signal including the estimated reading performance to the host.
 10. The estimation method according to claim 9, further comprising the following steps: demanding the controller to determine whether to receive the next reading performance query instruction after the reading performance estimation process has executed; and demanding the controller to execute the reading performance estimation process, again, after receiving the next writing performance query instruction. 